Skip to content

fix: reset config state after loading#25

Merged
chenjiahan merged 1 commit into
mainfrom
chenjiahan/fix-config-state-cleanup
Jul 11, 2026
Merged

fix: reset config state after loading#25
chenjiahan merged 1 commit into
mainfrom
chenjiahan/fix-config-state-cleanup

Conversation

@chenjiahan

Copy link
Copy Markdown
Member

This PR prevents stale Rstack configuration from leaking across config loads. It clears the shared config state before loading and uses finally to clean it after both successful and failed loads, with regression coverage for a config that registers define.app before throwing.

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: af532818-9bbf-436e-b262-21067791cb16

📥 Commits

Reviewing files that changed from the base of the PR and between 67571ee and cc29d2a.

📒 Files selected for processing (3)
  • packages/rstack/src/config.ts
  • packages/rstack/test/config/load-state/index.test.ts
  • packages/rstack/test/config/load-state/rstack.config.ts

📝 Walkthrough

Walkthrough

loadRstackConfig now clears shared configuration state before loading and guarantees cleanup after both successful and failed loads. A new test seeds existing state, loads a configuration that throws test config error, and verifies cleanup in a finally block.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: resetting config state after loading.
Description check ✅ Passed The description matches the changeset and accurately describes the state-reset and regression coverage updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chenjiahan/fix-config-state-cleanup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chenjiahan chenjiahan merged commit 39c5335 into main Jul 11, 2026
4 checks passed
@chenjiahan chenjiahan deleted the chenjiahan/fix-config-state-cleanup branch July 11, 2026 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant